-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set threads warnings #443
Set threads warnings #443
Conversation
Codecov Report
@@ Coverage Diff @@
## master #443 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 83 83
Lines 11866 11883 +17
=========================================
+ Hits 11866 11883 +17
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@@ -30,6 +30,11 @@ def set_device(self, name): | |||
log.warning("Numpy does not support device placement. " | |||
"Aborting device change.") | |||
|
|||
def set_threads(self, nthreads): | |||
log.warning("Numpy backend supports only single-thread execution." | |||
"Cannot change the number of threads.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Cannot change the number of threads.") | |
" Cannot change the number of threads.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, thanks.
Great, thanks. Could you please fix another issues I have just observed, when changing to numpy the device list is [], for symmetry with other backends I think we could simply say something like /CPU:0... |
I changed the default numpy device to "/CPU:0". Let me know if you agree with the last changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect, thank you.
Fixes #442 by:
qibo.set_threads
to update the number threads only for the currently active backend.qibo.set_threads
with the numpy or tensorflow backends which do not support this kind of thread setting.